<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\ImReport;
class ReportAudit extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'report:audit';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Report Audit';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return array
     */
    public function handle()
    {
        $imReportModel = new ImReport();
        $imReport = $imReportModel->where('status', 0)->orderBy('id', 'asc')->get()->toArray();

        foreach ($imReport as $key =>&$val)
        {
            $picture = $val['picture'];
            $picture = json_decode($picture, true);

            $content = $val['content'];
            $content = json_decode($content, true);
            \Log::info($content);

        }

        return Command::SUCCESS;
    }
}
